from PyQt5.QtWidgets import QFileDialog
import os

if not os.path.exists('./data'):
    os.mkdir('./data')

# 全国水情雨情
def china_label_choose_file():
    if not os.path.exists('./data/全国水情雨情'):
        os.makedirs('./data/全国水情雨情')

    paths = './data/全国水情日数据'
    filename = QFileDialog.getOpenFileName(None, 'Transfer file', paths)
    address = filename[0]
    return address


# 打开全国地质水表
def china_quality_choose_file():
    if not os.path.exists('data/全国地表水质日数据'):
            os.makedirs('data/全国地表水质日数据')

    paths='./data/全国地表水质日数据'
    filename = QFileDialog.getOpenFileName(None, 'Transfer file', paths)
    address = filename[0]
    return address

# 黄河水情日数据
def yellow_rain_choose_file():
    if not os.path.exists('data/黄河水情日数据'):
            os.makedirs('./data/黄河水情日数据')

    paths='./data/黄河水情日数据'
    filename = QFileDialog.getOpenFileName(None, 'Transfer file', paths)
    address = filename[0]
    return address

# 珠江水情日数据
def zhujiang_rain_choose_file():
    if not os.path.exists('data/珠江水情日数据'):
            os.makedirs('./data/珠江水情日数据')

    paths='./data/珠江水情日数据'
    filename = QFileDialog.getOpenFileName(None, 'Transfer file', paths)
    address = filename[0]
    return address

# 东江水情日数据
def dongjiang_water_choose_file():
    if not os.path.exists('./data/东江水情日数据'):
            os.makedirs('./data/东江水情日数据')

    paths='./data/东江水情日数据'
    filename = QFileDialog.getOpenFileName(None, 'Transfer file', paths)
    address = filename[0]
    return address

def guangdong_water_choose_file():
    if not os.path.exists('data/广东水情日数据'):
            os.makedirs('./data/广东水情日数据')

    paths='./data/广东水情日数据'
    filename = QFileDialog.getOpenFileName(None, 'Transfer file', paths)
    address = filename[0]
    return address

def guangdong_rain_choose_file():
    if not os.path.exists('data/广东雨情日数据'):
            os.makedirs('./data/广东雨情日数据')

    paths='./data/广东雨情日数据'
    filename = QFileDialog.getOpenFileName(None, 'Transfer file', paths)
    address = filename[0]
    return address